
/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

if( !_global.Tests )
    {
    _global.Tests = {};
    }

if( !Tests.global )
    {
    /* NameSpace: Tests.global
    */
    Tests.global = {};
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.global.AllTests = function( /*String*/ name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.global.AllTests.prototype = new buRRRn.ASTUce.TestCase();
Tests.global.AllTests.prototype.constructor = Tests.global.AllTests;

Tests.global.AllTests.suite = function()
    {
    var TestSuite = buRRRn.ASTUce.TestSuite;
    var suite     = new TestSuite( "global Tests" );
    //suite.simpleTrace = true;
    
    suite.addTest( new TestSuite( Tests.global.GetTypeOfTest ) );
    suite.addTest( new TestSuite( Tests.global.GetObjectPathTest ) );
    suite.addTest( new TestSuite( Tests.global.HasOwnPropertyTest ) );
    
    return suite;
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.global.GetObjectPathTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.global.GetObjectPathTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.global.GetObjectPathTest.prototype.constructor = Tests.global.GetObjectPathTest;

Tests.global.GetObjectPathTest.prototype.setUp = function()
    {
    this.originalConfig = buRRRn.core2.config.backwardCompatible;
    buRRRn.core2.changeConfig( {backwardCompatible:true} );
    }

Tests.global.GetObjectPathTest.prototype.tearDown = function()
    {
    buRRRn.core2.config.backwardCompatible = this.originalConfig;
    }

Tests.global.GetObjectPathTest.prototype.testObject = function()
    {
    _global.toto = {};
    _global.toto.titi = {};
    _global.toto.titi.tutu = {};
    
    this.assertEquals( GetObjectPath( _global.toto.titi.tutu ), "toto.titi.tutu", "GOP_001" );
    }

Tests.global.GetObjectPathTest.prototype.testFunction = function()
    {
    _global.toto = {};
    _global.toto.titi = {};
    _global.toto.titi.tutu = {};
    _global.toto.titi.tutu.something = function()
        {
        return "hello world";
        }
    
    this.assertEquals( GetObjectPath( _global.toto.titi.tutu.something ), "toto.titi.tutu.something", "GOP_002" );
    }

Tests.global.GetObjectPathTest.prototype.testConstructor = function()
    {
    _global.toto = {};
    _global.toto.titi = {};
    _global.toto.titi.tutu = function()
        {
        
        }
    
    _global.toto.titi.tutu.prototype.something = function()
        {
        return "hello world";
        }
    
    this.assertEquals( GetObjectPath( _global.toto.titi.tutu ), "toto.titi.tutu",              "GOP_003a" );
    /* you cannot enumerate prototype as they are marked DontEnum */
    this.assertEquals( GetObjectPath( _global.toto.titi.tutu.prototype.something ), undefined, "GOP_003b" );
    }

Tests.global.GetObjectPathTest.prototype.testCoreObject = function()
    {
    this.assertEquals( GetObjectPath( Array ),    "Array",    "GOP_004a" );
    this.assertEquals( GetObjectPath( Boolean ),  "Boolean",  "GOP_004b" );
    this.assertEquals( GetObjectPath( Date ),     "Date",     "GOP_004c" );
    this.assertEquals( GetObjectPath( Error ),    "Error",    "GOP_004d" );
    this.assertEquals( GetObjectPath( Function ), "Function", "GOP_004e" );
    this.assertEquals( GetObjectPath( Number ),   "Number",   "GOP_004f" );
    this.assertEquals( GetObjectPath( String ),   "String",   "GOP_004g" );
    this.assertEquals( GetObjectPath( Object ),   "Object",   "GOP_004h" );
    }

Tests.global.GetObjectPathTest.prototype.testScope = function()
    {
    _global.toto = {};
    _global.toto.titi = {};
    _global.toto.titi.tutu = {};
    
    this.assertEquals( GetObjectPath( toto.titi.tutu, toto ), "toto.titi.tutu", "GOP_005a" );
    this.assertEquals( GetObjectPath( toto.titi.tutu, toto.titi ), "toto.titi.tutu", "GOP_005b" );
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.global.GetTypeOfTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.global.GetTypeOfTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.global.GetTypeOfTest.prototype.constructor = Tests.global.GetTypeOfTest;

Tests.global.GetTypeOfTest.prototype.setUp = function()
    {
    this.originalConfig = buRRRn.core2.config.backwardCompatible;
    buRRRn.core2.changeConfig( {backwardCompatible:true} );
    }

Tests.global.GetTypeOfTest.prototype.tearDown = function()
    {
    buRRRn.core2.config.backwardCompatible = this.originalConfig;
    }

Tests.global.GetTypeOfTest.prototype.testObject = function()
    {
    var obj1, obj2;
    
    obj1 = new Object();
    obj2 = {};
    
    this.assertEquals( GetTypeOf( obj1 ), "object", "GTO_001a" );
    this.assertEquals( GetTypeOf( obj2 ), "object", "GTO_001b" );
    }

Tests.global.GetTypeOfTest.prototype.testNull = function()
    {
    var obj1;
    
    obj1 = null;
    
    this.assertEquals( GetTypeOf( obj1 ), "null", "GTO_002" );
    }

Tests.global.GetTypeOfTest.prototype.testUndefined = function()
    {
    var obj1;
    
    obj1 = undefined;
    
    this.assertEquals( GetTypeOf( obj1 ), "undefined", "GTO_003" );
    }

Tests.global.GetTypeOfTest.prototype.testArray = function()
    {
    var obj1, obj2;
    
    obj1 = new Array( 10 );
    obj2 = [0,1,2,3,4,5,6,7,8,9];
    
    this.assertEquals( GetTypeOf( obj1 ), "array", "GTO_004a" );
    this.assertEquals( GetTypeOf( obj2 ), "array", "GTO_004b" );
    }

Tests.global.GetTypeOfTest.prototype.testBoolean = function()
    {
    var obj1, obj2;
    
    obj1 = new Boolean( 0 );
    obj2 = true;
    
    this.assertEquals( GetTypeOf( obj1 ), "boolean", "GTO_005a" );
    this.assertEquals( GetTypeOf( obj2 ), "boolean", "GTO_005b" );
    }

Tests.global.GetTypeOfTest.prototype.testDate = function()
    {
    var obj1;
    
    obj1 = new Date();
    
    this.assertEquals( GetTypeOf( obj1 ), "date", "GTO_006" );
    }

Tests.global.GetTypeOfTest.prototype.testFunction = function()
    {
    var obj1, obj2;
    
    obj1 = function()
        {
        return "hello world";
        }
    
    function obj2()
        {
        return "bonjour le monde";
        }
    
    this.assertEquals( GetTypeOf( obj1 ), "function", "GTO_007a" );
    
    /* attention:
       test removed because of a FlashMX 2004 bug
       when you declare a function like that
       function someName()
        {
        //...
        }
       
       its reference resolve to undefined !?!
    */
    //this.assertEquals( GetTypeOf( obj2 ), "function", "GTO_007b" );
    
    }

Tests.global.GetTypeOfTest.prototype.testNumber = function()
    {
    var obj1, obj2;
    
    obj1 = new Number( 12345 );
    obj2 = 12345;
    
    this.assertEquals( GetTypeOf( obj1 ), "number", "GTO_008a" );
    this.assertEquals( GetTypeOf( obj2 ), "number", "GTO_008b" );
    }

Tests.global.GetTypeOfTest.prototype.testString = function()
    {
    var obj1, obj2;
    
    obj1 = new String( "hello" );
    obj2 = "world";
    
    this.assertEquals( GetTypeOf( obj1 ), "string", "GTO_009a" );
    this.assertEquals( GetTypeOf( obj2 ), "string", "GTO_009b" );
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.global.HasOwnPropertyTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.global.HasOwnPropertyTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.global.HasOwnPropertyTest.prototype.constructor = Tests.global.HasOwnPropertyTest;

Tests.global.HasOwnPropertyTest.prototype.testGlobal = function()
    {
    _global.toto = {};
    
    this.assertEquals( _global.hasOwnProperty( "toto" ), true,  "HOP_001a" );
    this.assertEquals( _global.hasOwnProperty( "tutu" ), false, "HOP_001b" );
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

if( !_global.Tests )
    {
    _global.Tests = {};
    }

if( !Tests.core2 )
    {
    /* NameSpace: Tests.core2
    */
    Tests.core2 = {};
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.core2.AllTests = function( /*String*/ name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.core2.AllTests.prototype = new buRRRn.ASTUce.TestCase();
Tests.core2.AllTests.prototype.constructor = Tests.core2.AllTests;

Tests.core2.AllTests.suite = function()
    {
    var TestSuite = buRRRn.ASTUce.TestSuite;
    var suite     = new TestSuite( "core2 Tests" );
    //suite.simpleTrace = true;
    
    suite.addTest( new TestSuite( Tests.core2.ObjectTest ) );
    suite.addTest( new TestSuite( Tests.core2.ArrayTest ) );
    suite.addTest( new TestSuite( Tests.core2.BooleanTest ) );
    suite.addTest( new TestSuite( Tests.core2.DateTest ) );
    suite.addTest( new TestSuite( Tests.core2.ErrorTest ) );
    suite.addTest( new TestSuite( Tests.core2.FunctionTest ) );
    suite.addTest( new TestSuite( Tests.core2.NumberTest ) );
    suite.addTest( new TestSuite( Tests.core2.StringTest ) );
    
    return suite;
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.core2.ArrayTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.core2.ArrayTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.core2.ArrayTest.prototype.constructor = Tests.core2.ArrayTest;

Tests.core2.ArrayTest.prototype.testConstructor = function()
    {
    //ARR_000
    }

Tests.core2.ArrayTest.prototype.testClone = function()
    {
    var arr1, arr2, arr3;
    
    arr1 = [ "a", {a:1, b:2}, new String("c"), "d", "e" ];
    arr2 = arr1.clone();
    arr3 = arr1.copy();
    
    this.assertEquals(  arr1, arr2,        "ARR_001a" );
    this.assertNotSame( arr1[1], arr3[1],  "ARR_001b" );
    this.assertEquals(  arr1[0], arr3[0],  "ARR_001c" );
    this.assertSame(    arr1[1], arr2[1],  "ARR_001d" );
    this.assertSame(    arr1[2], arr2[2],  "ARR_001e" );
    }

Tests.core2.ArrayTest.prototype.testConcat = function()
    {
    //ARR_002
    }

Tests.core2.ArrayTest.prototype.testContains = function()
    {
    var arr1;
    
    arr1 = [ "hello world",
             true,
             {a:"a", b:"b"},
             12345 ];
    
    this.assertTrue( arr1.contains( "hello world" ),  "ARR_003a" );
    this.assertTrue( arr1.contains( true ),           "ARR_003b" );
    this.assertTrue( arr1.contains( 12345 ),          "ARR_003c" );
    this.assertTrue( arr1.contains( {a:"a", b:"b"} ), "ARR_003d" );
    this.assertFalse( arr1.contains( false ),         "ARR_003e" );
    }

Tests.core2.ArrayTest.prototype.testCopy = function()
    {
    var arr1, arr2, arr3, arr4, f1;
    
    f1 = function() { return "hello world"; }
    
    arr1 = [ "hello world",
             true,
             {a:"a", b:"b"},
             12345,
             new Date(),
             f1,
             new String("hello") ];
    
    arr2 = arr1.copy();
    
    this.assertEquals( arr1, arr2, "ARR_004a" );
    
    arr3 = [ null, undefined, true, false ];
    arr4 = arr3.copy();
    
    this.assertEquals( arr3, arr4, "ARR_004b" );
    }

Tests.core2.ArrayTest.prototype.testCopyTo = function()
    {
    var arr1, arr2, arr3;
    
    arr1 = [ "a", "b", "c", "d", "e" ];
    arr2 = [];
    arr3 = [ "0", "1", "2", "3" ];
    
    arr1.copyTo( arr2 )
    arr1.copyTo( arr3, 2 );
    
    this.assertEquals( arr1, arr2,                          "ARR_006a" );
    this.assertEquals( ["0","1","a","b","c","d","e"], arr3, "ARR_006b" );
    }

Tests.core2.ArrayTest.prototype.testEquals = function()
    {
    var arr1, arr2, arr3, arr4, arr5;
    
    arr1 = [ "a", new Boolean(true), 123, {a:1,b:2} ];
    arr2 = arr1.copy();
    arr3 = [ new String("a"), true, 123, {a:1,b:2} ];
    arr4 = [ null, null, null ];
    arr5 = [ undefined, undefined, undefined ];
    
    this.assertTrue( arr1.equals( arr2 ),          "ARR_007a" );
    this.assertTrue( arr1.equals( arr3 ),          "ARR_007b" );
    this.assertEquals( arr4, [ null, null, null ], "ARR_007c" );
    this.assertEquals( arr5, [ undefined, undefined, undefined ], "ARR_007d" );
    }

Tests.core2.ArrayTest.prototype.testStaticFromArguments = function()
    {
    var arr1, fct1;
    
    arr1 = []
    
    fct1 = function( a, b, c, d )
        {
        arr1 = Array.fromArguments( arguments );
        }
    
    fct1( 1, 2, 3, 4 );
    
    this.assertTrue( GetTypeOf( arr1 ) == "array",  "ARR_008a" );
    this.assertEquals( [1,2,3,4], arr1,             "ARR_008b" );
    }

Tests.core2.ArrayTest.prototype.testIndexOf = function()
    {
    var arr1;
    
    arr1 = [ null, "hello world", [1,2,3] ];
    
    this.assertEquals( arr1.indexOf( null ), 0,          "ARR_009a" );
    this.assertEquals( arr1.indexOf( "hello world" ), 1, "ARR_009b" );
    this.assertEquals( arr1.indexOf( [1,2,3] ), 2,       "ARR_009c" );
    this.assertEquals( arr1.indexOf( [1,2,3], 2 ), 2,    "ARR_009d" );
    }

Tests.core2.ArrayTest.prototype.testStaticInitialize = function()
    {
    var arr1, arr2, arr3;
    
    arr1 = Array.initialize( 3 );
    arr2 = Array.initialize( 3, 0 );
    arr3 = Array.initialize( 3, "" );
    
    this.assertEquals( arr1, [null,null,null], "ARR_010a" );
    this.assertEquals( arr2, [0,0,0],          "ARR_010b" );
    this.assertEquals( arr3, ["","",""],       "ARR_010c" );
    }

Tests.core2.ArrayTest.prototype.testJoin = function()
    {
    //ARR_011
    }

Tests.core2.ArrayTest.prototype.testPop = function()
    {
    //ARR_012
    }

Tests.core2.ArrayTest.prototype.testPush = function()
    {
    //ARR_013
    }

Tests.core2.ArrayTest.prototype.testReverse = function()
    {
    //ARR_014
    }

Tests.core2.ArrayTest.prototype.testShift = function()
    {
    //ARR_015
    }

Tests.core2.ArrayTest.prototype.testSlice = function()
    {
    //ARR_016
    }

Tests.core2.ArrayTest.prototype.testSort = function()
    {
    //ARR_017
    }

Tests.core2.ArrayTest.prototype.testSplice = function()
    {
    //ARR_018
    }

Tests.core2.ArrayTest.prototype.testUnshift = function()
    {
    //ARR_020
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.core2.BooleanTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.core2.BooleanTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.core2.BooleanTest.prototype.constructor = Tests.core2.BooleanTest;

Tests.core2.BooleanTest.prototype.testConstructor = function()
    {
    //BOOL_000
    }

Tests.core2.BooleanTest.prototype.testCompareTo = function()
    {
    var bool1, bool2, bool3;
    
    bool1 = false;
    bool2 = new Boolean( true );
    bool3 = new Boolean( 0 );
    
    this.assertEquals( bool1.compareTo( bool2 ), -1, "BOOL_001a" );
    this.assertEquals( bool1.compareTo( bool3 ),  0, "BOOL_001b" );
    this.assertEquals( bool2.compareTo( bool3 ),  1, "BOOL_001c" );
    this.assertEquals( bool2.compareTo( null  ),  1, "BOOL_001d" );
    }

Tests.core2.BooleanTest.prototype.testClone = function()
    {
    //BOOL_002
    }

Tests.core2.BooleanTest.prototype.testCopy = function()
    {
    //BOOL_003
    }

Tests.core2.BooleanTest.prototype.testEquals = function()
    {
    var bool1, bool2, bool3;
    
    bool1 = true;
    bool2 = new Boolean( true );
    bool3 = new Boolean( 0 );
    
    this.assertEquals( bool1, bool2,         "BOOL_004a" );
    this.assertFalse( bool1.equals( bool3 ), "BOOL_004b" );
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.core2.DateTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.core2.DateTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.core2.DateTest.prototype.constructor = Tests.core2.DateTest;

Tests.core2.DateTest.prototype.testConstructor = function()
    {
    //DAT_000
    }

Tests.core2.DateTest.prototype.testClone = function()
    {
    var dat1, dat2;
    
    dat1 = new Date();
    dat2 = dat1.clone();
    
    this.assertSame( dat1, dat2,   "DAT_001a" );
    this.assertEquals( dat1, dat2, "DAT_001b" );
    }

Tests.core2.DateTest.prototype.testCopy = function()
    {
    var dat1, dat2;
    
    dat1 = new Date();
    dat2 = dat1.copy();
    
    this.assertEquals( dat1, dat2,  "DAT_002a" );
    this.assertNotSame( dat1, dat2, "DAT_002b" );
    }

Tests.core2.DateTest.prototype.testEquals = function()
    {
    var dat1, dat2, dat3, dat4;
    
    dat1 = new Date();
    dat2 = dat1.copy();
    dat3 = new Date( 2005, 03, 21 );
    dat4 = new Date( 2005, 03, 30 );
    
    this.assertEquals( dat1, dat2,       "DAT_003a" );
    this.assertFalse( dat3.equals(dat4), "DAT_003b" );
    }

Tests.core2.DateTest.prototype.testGetSetDate = function()
    {
    //DAT_004
    }

Tests.core2.DateTest.prototype.testGetDay = function()
    {
    //DAT_005
    }

Tests.core2.DateTest.prototype.testGetSetFullYear = function()
    {
    //DAT_006
    }

Tests.core2.DateTest.prototype.testGetSetHours = function()
    {
    //DAT_007
    }

Tests.core2.DateTest.prototype.testGetSetMilliseconds = function()
    {
    //DAT_008
    }

Tests.core2.DateTest.prototype.testGetSetMinutes = function()
    {
    //DAT_009
    }

Tests.core2.DateTest.prototype.testGetSetMonth = function()
    {
    //DAT_010
    }

Tests.core2.DateTest.prototype.testGetSetSeconds = function()
    {
    //DAT_011
    }

Tests.core2.DateTest.prototype.testGetSetTime = function()
    {
    //DAT_012
    }

Tests.core2.DateTest.prototype.testGetTimezoneOffset = function()
    {
    //DAT_013
    }

Tests.core2.DateTest.prototype.testGetSetUTCDate = function()
    {
    //DAT_014
    }

Tests.core2.DateTest.prototype.testGetUTCDay = function()
    {
    //DAT_015
    }

Tests.core2.DateTest.prototype.testGetSetUTCFullYear = function()
    {
    //DAT_016
    }

Tests.core2.DateTest.prototype.testGetSetUTCHours = function()
    {
    //DAT_017
    }

Tests.core2.DateTest.prototype.testGetSetUTCMilliseconds = function()
    {
    //DAT_018
    }

Tests.core2.DateTest.prototype.testGetSetUTCMinutes = function()
    {
    //DAT_019
    }

Tests.core2.DateTest.prototype.testGetSetUTCMonth = function()
    {
    //DAT_020
    }

Tests.core2.DateTest.prototype.testGetSetUTCSeconds = function()
    {
    //DAT_021
    }

Tests.core2.DateTest.prototype.testStaticParse = function()
    {
    //DAT_022
    }

Tests.core2.DateTest.prototype.testToGMTString = function()
    {
    //DAT_023
    }

Tests.core2.DateTest.prototype.testToString = function()
    {
    //DAT_025
    }

Tests.core2.DateTest.prototype.testToUTCString = function()
    {
    //DAT_026
    }

Tests.core2.DateTest.prototype.testStaticUTC = function()
    {
    //DAT_027
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.core2.ErrorTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.core2.ErrorTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.core2.ErrorTest.prototype.constructor = Tests.core2.ErrorTest;

Tests.core2.ErrorTest.prototype.testConstructor = function()
    {
    var err1;
    
    err1 = new Error();
    
    this.assertEquals( err1.name, "Error",              "ERR_000a" );
    this.assertEquals( err1.message, "",                "ERR_000b" );
    this.assertEquals( err1.message, err1.getMessage(), "ERR_000c" );
    }

Tests.core2.ErrorTest.prototype.testEquals = function()
    {
    var err1, err2, obj1;
    
    err1 = new Error( "hello world" );
    err2 = new Error( "hello world" );
    obj1 = {};
    obj1.name    = "Error";
    obj1.message = "hello world";
    
    this.assertEquals( err1, err2,         "ERR_001a" );
    this.assertFalse( err1.equals( null ), "ERR_001b" );
    this.assertFalse( err1.equals( obj1 ), "ERR_001c" );
    }

Tests.core2.ErrorTest.prototype.testGetMessage = function()
    {
    //ERR_002
    }

Tests.core2.ErrorTest.prototype.testToString = function()
    {
    var err1, err2;
    
    err1 = new Error( "hello world" );
    err2 = new Error();
    
    this.assertEquals( err1.toString(), "## Error : hello world ##", "ERR_004a" );
    this.assertEquals( err2.toString(), "## Error ##",               "ERR_004b" );
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.core2.FunctionTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.core2.FunctionTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.core2.FunctionTest.prototype.constructor = Tests.core2.FunctionTest;

Tests.core2.FunctionTest.prototype.testConstructor = function()
    {
    //FCT_000
    }

Tests.core2.FunctionTest.prototype.testApply = function()
    {
    //FCT_001
    }

Tests.core2.FunctionTest.prototype.testCall = function()
    {
    //FCT_002
    }

Tests.core2.FunctionTest.prototype.testClone = function()
    {
    var fct1, fct2, fct3;
    
    fct1 = function() { return "hello world"; };
    fct2 = fct1.clone();
    fct3 = fct1.copy();
    
    this.assertEquals( fct1, fct2,  "FCT_003a" );
    this.assertSame( fct1, fct2,    "FCT_003b" );
    this.assertSame( fct1, fct3,    "FCT_003c" );
    }

Tests.core2.FunctionTest.prototype.testCopy = function()
    {
    var fct1, fct2, fct3;
    
    fct1 = function() { return "hello world"; };
    fct2 = fct1.copy();
    fct3 = fct1.clone();
    
    this.assertEquals( fct1, fct2, "FCT_004a" );
    this.assertEquals( fct1, fct3, "FCT_004b" );
    }

Tests.core2.FunctionTest.prototype.testEquals = function()
    {
    var fct1, fct2, fct3, fct4;
    
    fct1 = function() { return "hello world"; };
    fct2 = fct1;
    fct3 = function() { return "hello world"; };
    function fct4()
        {
        return "hello world";
        }
    
    this.assertEquals( fct1, fct2,         "FCT_005a" );
    this.assertFalse( fct1.equals( fct4 ), "FCT_005b" );
    
    /* note:
       in ActionScript we can not obtain the function body
       with the toString method, and so we can not define
       as true two same function body for two different reference.
    */
    //this.assertEquals( fct1, fct3,         "FCT_005c" );
    
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.core2.NumberTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.core2.NumberTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.core2.NumberTest.prototype.constructor = Tests.core2.NumberTest;

Tests.core2.NumberTest.prototype.testConstructor = function()
    {
    //NUM_000
    }

Tests.core2.NumberTest.prototype.testClone = function()
    {
    var num1, num2, num3, num4;
    
    num1 = 123456789;
    num2 = new Number( 987654321 );
    num3 = num1.clone();
    num4 = num2.clone();
    
    this.assertNotSame( num1, num3,      "NUM_001a" );
    this.assertEquals( num1, num3,       "NUM_001b" );
    this.assertSame( num2, num4,         "NUM_001c" );
    this.assertEquals( num2, num4,       "NUM_001d" );
    num2 += 1024;
    this.assertNotSame( num2, num4,      "NUM_001e" );
    this.assertFalse( num2.equals(num4), "NUM_001f" );
    }

Tests.core2.NumberTest.prototype.testCopy = function()
    {
    var num1, num2, num3, num4;
    
    num1 = 123456789;
    num2 = new Number( 987654321 );
    num3 = num1.copy();
    num4 = num2.copy();
    
    this.assertEquals( num1, num3,         "NUM_002a" );
    this.assertEquals( num2, num4,         "NUM_002b" );
    this.assertNotSame( num2, num4,        "NUM_002c" );
    num1 += 1024;
    this.assertFalse( num1.equals( num3 ), "NUM_002d" );
    }
 
Tests.core2.NumberTest.prototype.testEquals = function()
    {
    var num1, num2, num3;
    
    num1 = new Number( 255 );
    num2 = 255;
    num3 = 0xF;
    
    this.assertEquals( num1, num2,         "NUM_002a" );
    this.assertEquals( num2, num1,         "NUM_002b" );
    this.assertTrue( num1.equals( num1 ),  "NUM_002c" );
    this.assertTrue( num2.equals( num2 ),  "NUM_002d" );
    this.assertTrue( num1.equals( num2 ),  "NUM_002e" );
    this.assertTrue( num2.equals( num1 ),  "NUM_002f" );
    this.assertFalse( num1.equals( null ), "NUM_002g" );
    this.assertFalse( num1.equals( num3 ), "NUM_002h" );
    }

Tests.core2.NumberTest.prototype.testToExponential = function()
    {
    //NUM_004
    }

Tests.core2.NumberTest.prototype.testToFixed = function()
    {
    //NUM_005
    }

Tests.core2.NumberTest.prototype.testToPrecision = function()
    {
    //NUM_008
    }



/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.core2.ObjectTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.core2.ObjectTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.core2.ObjectTest.prototype.constructor = Tests.core2.ObjectTest;

Tests.core2.ObjectTest.prototype.testConstructor = function()
    {
    //OBJ_000
    }

Tests.core2.ObjectTest.prototype.testClone = function()
    {
    var obj1, obj2;
    
    obj1 = { A:"hello", B:"world" };
    obj2 = obj1.clone();
    
    this.assertSame( obj1, obj2,   "OBJ_001a" );
    this.assertEquals( obj1, obj2, "OBJ_001b" );
    }

Tests.core2.ObjectTest.prototype.testConstructorProperty = function()
    {
    var arr1, bool1, dat1, err1, fct1, num1, obj1, str1;
    
    arr1 = [1,2,3];
    bool1 = true;
    dat1 = new Date();
    err1 = new Error( "test" );
    fct1 = function() { return "hello world"; };
    num1 = 12345;
    obj1 = {a:1, b:2};
    str1 = "hello world";
    
    this.assertTrue( arr1.constructor  == Array,    "OBJ_002a" );
    this.assertTrue( bool1.constructor == Boolean, "OBJ_002b" );
    this.assertTrue( dat1.constructor  == Date,     "OBJ_002c" );
    this.assertTrue( err1.constructor  == Error,    "OBJ_002d" );
    this.assertTrue( fct1.constructor  == Function, "OBJ_002e" );
    this.assertTrue( num1.constructor  == Number,   "OBJ_002f" );
    this.assertTrue( obj1.constructor  == Object,   "OBJ_002g" );
    this.assertTrue( str1.constructor  == String,   "OBJ_002h" );
    }

Tests.core2.ObjectTest.prototype.testCopy = function()
    {
    var obj1, obj2;
    
    obj1 = { A:"hello", B:"world" };
    obj2 = obj1.copy();
    
    this.assertNotSame( obj1, obj2,   "OBJ_003a" );
    this.assertEquals( obj1, obj2,    "OBJ_003b" );
    }

Tests.core2.ObjectTest.prototype.testEquals1 = function()
    {
    var obj1, obj2;
    
    obj1 = { A:"hello", B:"world" };
    obj2 = { A:"hello", B:"world" };
    
    this.assertEquals( obj1, obj1,        "OBJ_004a" );
    this.assertTrue( obj1.equals( obj2 ), "OBJ_004b" );
    this.assertEquals( obj1, obj2,        "OBJ_004c" );
    }

Tests.core2.ObjectTest.prototype.testEquals2 = function()
    {
    var obj1, obj2;
    
    obj1 = { A:"hello", B:"world" };
    obj2 = { A:"hello", B:"world", C:"test" };
    
    this.assertEquals( obj1, obj2, "OBJ_005" );
    }

Tests.core2.ObjectTest.prototype.testEquals3 = function()
    {
    var obj1, obj2;
    
    obj1 = { A:"hello", B:"world", C:"test" };
    obj2 = { A:"hello", B:"world"};
    
    this.assertFalse( obj1.equals( obj2 ), "OBJ_006" );
    }

Tests.core2.ObjectTest.prototype.testHasOwnProperty = function()
    {
    var obj1;
    
    obj1 = new Object();
    obj1.test = "hello world";
    
    this.assertTrue( obj1.hasOwnProperty( "test" ),      "OBJ_007" );
    this.assertFalse( obj1.hasOwnProperty( "toString" ), "OBJ_007" );
    }

Tests.core2.ObjectTest.prototype.testHasProperty = function()
    {
    var obj;
    
    obj = {};
    obj.hello = "world";
    
    this.assertTrue( obj.hasProperty( "hello" ),    "OBJ_008a" );
    this.assertFalse( obj.hasProperty( "world" ),   "OBJ_008b" );
    this.assertTrue( obj.hasProperty( "toString" ), "OBJ_008c" );
    }

Tests.core2.ObjectTest.prototype.testIsPrototypeOf = function()
    {
    var obj1;
    
    obj1 = new Array();
    
    this.assertTrue( Array.prototype.isPrototypeOf( obj1 ),    "OBJ_009a" );
    this.assertTrue( Object.prototype.isPrototypeOf( obj1 ),   "OBJ_009b" );
    this.assertFalse( Boolean.prototype.isPrototypeOf( obj1 ), "OBJ_009c" );
    }

Tests.core2.ObjectTest.prototype.testMemberwiseClone = function()
    {
    var obj1, obj2, arr1;
    
    arr1 = [1,2,3];
    obj1 = {a:arr1,b:true,c:123};
    obj2 = obj1.memberwiseClone();
    
    this.assertEquals( obj1, obj2,     "OBJ_010a" );
    this.assertNotSame( obj1, obj2,    "OBJ_010b" );
    this.assertEquals( obj1.a, obj2.a, "OBJ_010c" );
    this.assertSame( obj1.a, obj2.a,   "OBJ_010d" );
    }

Tests.core2.ObjectTest.prototype.testMemberwiseCopy = function()
    {
    var obj1, obj2, arr1;
    
    arr1 = [1,2,3];
    obj1 = {a:arr1,b:true,c:123};
    obj2 = obj1.memberwiseCopy();
    
    this.assertEquals( obj1, obj2,      "OBJ_011a" );
    this.assertNotSame( obj1, obj2,     "OBJ_011b" );
    this.assertEquals( obj1.a, obj2.a,  "OBJ_011c" );
    this.assertNotSame( obj1.a, obj2.a, "OBJ_011d" );
    }

Tests.core2.ObjectTest.prototype.testPropertyIsEnumerable = function()
    {
    var obj1, obj2;
    
    obj1 = {};
    obj1.test = "hello world";
    
    this.assertTrue( obj1.propertyIsEnumerable( "test" ),                  "OBJ_012a" );
    this.assertFalse( obj1.propertyIsEnumerable( "something" ),            "OBJ_013b" );
    
    /* note:
       as we can't define the DontEnum attribute (except for ActionScript)
       we have to test on build-in property we know
       are not enumerable.
    */
    this.assertFalse( Object.prototype.propertyIsEnumerable( "toString" ), "OBJ_012c" );
    this.assertFalse( _global.propertyIsEnumerable( "Object" ),            "OBJ_012d" );
    }

Tests.core2.ObjectTest.prototype.testReferenceEquals = function()
    {
    var obj1, obj2, obj3, obj4;
    
    obj1 = { A:"hello", B:"world"};
    obj2 = obj1;
    obj3 = { A:"hello", B:"world"};
    obj4 = obj1.clone();
    
    this.assertTrue( obj1.referenceEquals( obj2 ),  "OBJ_013a" );
    this.assertFalse( obj1.referenceEquals( obj3 ), "OBJ_013b" );
    this.assertFalse( obj1.referenceEquals( null ), "OBJ_013c" );
    this.assertTrue( obj1.referenceEquals( obj4 ),  "OBJ_013d" );
    }


/*
  The contents of this file are subject to the Mozilla Public License Version
  1.1 (the "License"); you may not use this file except in compliance with
  the License. You may obtain a copy of the License at 
  http://www.mozilla.org/MPL/ 
  
  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  for the specific language governing rights and limitations under the License. 
  
  The Original Code is core2: ECMAScript core objects 2nd gig. 
  
  The Initial Developer of the Original Code is
  Zwetan Kjukov <zwetan@gmail.com>.
  Portions created by the Initial Developer are Copyright (C) 2003-2007
  the Initial Developer. All Rights Reserved.
  
  Contributor(s):
*/

Tests.core2.StringTest = function( name )
    {
    buRRRn.ASTUce.TestCase.call( this, name );
    }

Tests.core2.StringTest.prototype = new buRRRn.ASTUce.TestCase();
Tests.core2.StringTest.prototype.constructor = Tests.core2.StringTest;

Tests.core2.StringTest.prototype.testConstructor = function()
    {
    //STR_000
    }

Tests.core2.StringTest.prototype.testCharAt = function()
    {
    //STR_001
    }

Tests.core2.StringTest.prototype.testCharCodeAt = function()
    {
    //STR_002
    }

Tests.core2.StringTest.prototype.testClone = function()
    {
    var str1, str2, str3, str4;
    
    str1 = new String( "hello world" );
    str2 = "hello world";
    str3 = str1.clone();
    str4 = str2.clone();
    
    this.assertEquals( str1, str3,                       "STR_003a" );
    this.assertSame( str1, str3,                         "STR_003b" );
    this.assertFalse( str2.referenceEquals(str4), "STR_003c" );
    }

Tests.core2.StringTest.prototype.testStaticCompare = function()
    {
    var str1, str2, str3, str4;
    
    str1 = new String("hello world");
    str2 = "hello world";
    str3 = "hello worl";
    str4 = "HELLO WORLD";
    
    this.assertEquals( String.compare( str1, null ),  1,       "STR_004a" );
    this.assertEquals( String.compare( null, str1 ), -1,       "STR_004b" );
    this.assertEquals( String.compare( str1, str2 ),  0,       "STR_004c" );
    this.assertEquals( String.compare( str2, str3 ),  1,       "STR_004d" );
    this.assertEquals( String.compare( str3, str2 ), -1,       "STR_004e" );
    this.assertEquals( String.compare( null, null ),  0,       "STR_004f" );
    this.assertEquals( String.compare( str2, str4, true ),  0, "STR_004g" );
    }

Tests.core2.StringTest.prototype.testCompareTo = function()
    {
    var str1, str2, str3, obj1;
    
    str1 = new String("hello world");
    str2 = "hello world";
    str3 = "hello worl";
    obj1 = {};
    
    this.assertEquals( str1.compareTo( null ),  1,         "STR_005a" );
    this.assertEquals( str1.compareTo( str2 ),  0,         "STR_005b" );
    this.assertEquals( str1.compareTo( str3 ),  1,         "STR_005c" );
    this.assertEquals( str3.compareTo( str2 ), -1,         "STR_005d" );
    this.assertEquals( str1.compareTo( obj1 ),  undefined, "STR_005e" );
    }

Tests.core2.StringTest.prototype.testConcat = function()
    {
    //STR_006
    }

Tests.core2.StringTest.prototype.testCopy = function()
    {
    var str1, str2, str3, str4;
    
    str1 = new String("hello world");
    str2 = "hello world";
    str3 = str1.copy();
    str4 = str2.copy();
    
    this.assertEquals( str1, str3,  "STR_007a" );
    this.assertNotSame( str1, str3, "STR_007b" );
    this.assertEquals( str2, str4,  "STR_007c" );
    }

Tests.core2.StringTest.prototype.testEquals = function()
    {
    var str1, str2, str3;
    
    str1 = "hello world";
    str2 = "hello world";
    str3 = "bonjour le monde";
    
    this.assertTrue( str1.equals( str2 ),   "STR_008a" );
    this.assertFalse( str1.equals( str3 ),  "STR_008b" );
    this.assertFalse( str1.equals( null ),  "STR_008c" );
    }

Tests.core2.StringTest.prototype.testEndsWith = function()
    {
    var str1, str2, str3;
    
    str1 = "hello world";
    str2 = "world";
    str3 = "monde";
    
    this.assertTrue( str1.endsWith( str2 ),   "STR_009a" );
    this.assertFalse( str1.endsWith( str3 ),  "STR_009b" );
    this.assertFalse( str1.endsWith( null ),  "STR_009c" );
    }

Tests.core2.StringTest.prototype.testStaticFormat = function()
    {
    var str1 = "hello {0}";
    var str2 = "hello {{escape}} world";
    var str3 = "one {{ escape";
    var str4 = "one }} escape";
    var str5 = "say {{{0}}}";
    var str6 = "say {left}{0}{right}";
    var str7 = "hello {world}";
    
    this.assertEquals( "hello world", String.format( str1, "world" ), "STR_010a" );
    this.assertEquals( "hello world", String.format( str1, ["world"] ), "STR_010b" );
    
    this.assertEquals( "hello {escape} world", String.format( str2, "world" ), "STR_010c" );
    this.assertEquals( "one { escape", String.format( str3, "world" ), "STR_010d" );
    this.assertEquals( "one } escape", String.format( str4, "world" ), "STR_010e" );
    this.assertEquals( "say {hello}", String.format( str5, "hello" ), "STR_010f" );
    this.assertEquals( "say {{{{hello}}}}", String.format( str6, {left:"{{{{", right:"}}}}"}, "hello" ), "STR_010g" );
    
    this.assertEquals( "hello world", String.format( str7, {world:"world"} ), "STR_010h" );
    }

Tests.core2.StringTest.prototype.testStaticFormatOptions = function()
    {
    var str1 = "hello {0,10}";
    var str2 = "hello {0,-10}";
    var str3 = "hello {0,-10:_}";
    var str4 = "my {token,10}";
    var str5 = "my {token,-10}";
    var str6 = "my {token,10:.}";
    
    this.assertEquals( "hello      world", String.format( str1, "world" ), "STR_011a" );
    this.assertEquals( "hello world     ", String.format( str2, "world" ), "STR_011b" );
    this.assertEquals( "hello world_____", String.format( str3, "world" ), "STR_011c" );
    this.assertEquals( "my      token", String.format( str4, {token:"token"} ), "STR_011d" );
    this.assertEquals( "my token     ", String.format( str5, {token:"token"} ), "STR_011e" );
    this.assertEquals( "my .....token", String.format( str6, {token:"token"} ), "STR_011f" );
    }

Tests.core2.StringTest.prototype.testStaticFromCharCode = function()
    {
    //STR_011
    }

Tests.core2.StringTest.prototype.testIndexOf = function()
    {
    //STR_012
    }

Tests.core2.StringTest.prototype.testIndexOfAny = function()
    {
    //STR_013
    }

Tests.core2.StringTest.prototype.testInsert = function()
    {
    //STR_014
    }

Tests.core2.StringTest.prototype.testLastIndexOf = function()
    {
    //STR_015
    }

Tests.core2.StringTest.prototype.testLastIndexOfAny = function()
    {
    //STR_016
    }

Tests.core2.StringTest.prototype.testPadLeft = function()
    {
    //STR_017
    }

Tests.core2.StringTest.prototype.testPadRight = function()
    {
    //STR_018
    }

Tests.core2.StringTest.prototype.TestReplace = function()
    {
    var str1, str2;
    
    str1 = "123abc456";
    str2 = "x";
    
    this.assertEquals( str1.replace( "abc", "000" ), "123000456", "STR_019a" );
    this.assertEquals( str1.replace( "abc", "" ),    "123456",    "STR_019b" );
    this.assertEquals( str2.replace( "", "" ),        str2,       "STR_019c" );
    this.assertEquals( str2.replace( "x", "a" ),     "a",         "STR_019d" );
    }

Tests.core2.StringTest.prototype.testSlice = function()
    {
    //STR_020
    }

Tests.core2.StringTest.prototype.testSplit = function()
    {
    //STR_021
    }

Tests.core2.StringTest.prototype.testStartsWith = function()
    {
    var str1, str2, str3;
    
    str1 = "hello world";
    str2 = "hello";
    str3 = "monde";
    
    this.assertTrue( str1.startsWith( str2 ),   "STR_022a" );
    this.assertFalse( str1.startsWith( str3 ),  "STR_022b" );
    this.assertFalse( str1.startsWith( null ),  "STR_022c" );
    }

Tests.core2.StringTest.prototype.testSubstr = function()
    {
    //STR_023
    }

Tests.core2.StringTest.prototype.testSubstring = function()
    {
    //STR_024
    }

Tests.core2.StringTest.prototype.testToCharArray = function()
    {
    //STR_026
    }

Tests.core2.StringTest.prototype.testToLowerCase = function()
    {
    //STR_027
    }

Tests.core2.StringTest.prototype.testToUpperCase = function()
    {
    //STR_032
    }

Tests.core2.StringTest.prototype.testTrim = function()
    {
    //STR_033
    }

Tests.core2.StringTest.prototype.testTrimEnd = function()
    {
    //STR_034
    }

Tests.core2.StringTest.prototype.testTrimStart = function()
    {
    //STR_035
    }


